cmake_minimum_required(VERSION 3.16)

include_directories(${CMAKE_SOURCE_DIR}/include/visionhw)

add_executable(test test.cpp)
add_executable(viewer viewer.cpp)

find_package(OpenCV REQUIRED)
include_directories( ${OpenCV_INCLUDE_DIRS} )
target_link_libraries( test ${OpenCV_LIBS} )
target_link_libraries( viewer ${OpenCV_LIBS} )

set(BOOST_ROOT /usr/local/boost)
find_package(Boost COMPONENTS json thread system REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries (test ${Boost_LIBRARIES} pthread)
target_link_libraries (viewer ${Boost_LIBRARIES} pthread)

find_package(PCL REQUIRED)
set(BOOST_ROOT /usr/local/boost)
include_directories(${PCL_INCLUDE_DIRS})
target_link_libraries(test ${PCL_LIBRARIES})
target_link_libraries(viewer ${PCL_LIBRARIES})

find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
include_directories(${JSONCPP_INCLUDE_DIRS})
target_link_libraries(test ${JSONCPP_LIBRARIES})
target_link_libraries(viewer ${JSONCPP_LIBRARIES})
message(STATUS ${JSONCPP_INCLUDE_DIRS})
message(STATUS ${JSONCPP_LIBRARIES})

target_link_libraries(test visionhw)
target_link_libraries(viewer visionhw)